package com.ucpaas.task;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by:xiaoqingwen   on 2018/4/4 on 16:14
 */
@Component
public class ScheduledTasks {

    private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
    @Scheduled(fixedRate = 0)
    public void reportCurrentTime(){
        System.out.println("当前时间为-->"+dateFormat.format(new Date()));
    }
}
